<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="blogfragments :: head(~{::title})">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>分类管理</title>
  <link rel="stylesheet" href="../static/css/semantic.min.css">
  <link rel="stylesheet" type="text/css" href="../static/css/manster.css"/>
</head>
<body>

  <!--导航-->
  <nav th:replace="blogfragments :: menu(2)" class="ui inverted attached segment m-padded-tb-mini">
    <div class="ui container">
      <div class="ui inverted secondary stackable menu">
        <h2 class="ui blue header item">MansterBlog</h2>
        <a href="#" class="active m-item item m-mobile-hide"><i class="small home icon"></i>首页</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="small idea icon"></i>分类</a>
        <a href="#" class="m-item item m-mobile-hide"><i class="small tags icon"></i>标签</a>
        <div class="right m-item m-mobile-hide menu">
          <div class="ui dropdown  item">
            <div class="text">
              <img class="ui avatar image" src="https://picsum.photos/id/0/100/100">
              manster
            </div>
            <i class="dropdown icon"></i>
            <div class="menu">
              <a href="#" class="item">注销</a>
            </div>
          </div>
        </div>
      </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
      <i class="sidebar icon"></i>
    </a>
  </nav>
  <div class="ui attached pointing menu">
    <div class="ui container">
      <div class="right menu">
        <a href="#" th:href="@{/admin/types/input}" class="item">新增</a>
        <a href="#" th:href="@{/admin/types}" class="active blue item">列表</a>
      </div>
    </div>
  </div>

  <!--中间内容-->
  <div  class="m-container-small m-padded-tb-big">
    <div class="ui container">
      <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
        <i class="close icon"></i>
        <div class="header">提示：</div>
        <p th:text="${message}">恭喜，操作成功！</p>
      </div>
      <table class="ui selectable teal celled table">
        <thead>
          <tr class="center aligned">
            <th>序号</th>
            <th>名称</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr th:each="type,iterStat : ${page.records}" class="center aligned">
            <td th:text="${iterStat.count}">1</td>
            <td th:text="${type.name}">学习笔记</td>
            <td>
              <a href="#" th:href="@{/admin/types/{id}/edit(id=${type.id})}" class="ui mini blue button">
                <i class="ui edit icon"></i>
                编辑
              </a>
              <a href="#" th:href="@{/admin/types/{id}/delete(id=${type.id})}" class="ui mini red button">
                <i class="ui trash alternate icon"></i>
                删除
              </a>
            </td>
          </tr>
        </tbody>
        <tfoot>
        <tr class="center aligned">
          <th colspan="6">
            <div class="ui small pagination menu" th:if="${page.pages} gt 1">
              <a th:href="@{/admin/types(current=${page.current}-1)}" class="icon item" th:unless="${page.current le 1}">
                <i class="left chevron icon"></i>上一页
              </a>
              <a th:href="@{/admin/types(current=1)}" class="item">1</a>
              <a th:href="@{/admin/types(current=2)}" class="item">2</a>
              <a th:href="@{/admin/types(current=${page.current}+1)}" class="icon item" th:unless="${page.current ge page.pages}">
                下一页<i class="right chevron icon"></i>
              </a>
            </div>
            <a href="#" th:href="@{/admin/types/input}" class="ui small right floated teal button">
              <i class="ui plus icon"></i>
              新增
            </a>
          </th>
        </tr>
        </tfoot>
      </table>
    </div>
  </div>

  <!--底部footer-->
  <footer th:replace="blogfragments :: footer" class="ui inverted vertical segment m-padded-tb-large">
    <div class="ui center aligned container">
      <div class="ui inverted divided stackable grid">
        <div class="three wide column">
          <div class="ui inverted link list">
            <div class="item">
              <img src="../static/images/weichat.jpg" class="ui rounded image" alt="" style="width: 110px;">
            </div>
          </div>
        </div>
        <div class="three wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced">最新Blog</h4>
          <div class="ui inverted link list">
            <a href="#" class="item">java 多线程</a>
            <a href="#" class="item">java 集合</a>
            <a href="#" class="item">java 反射</a>
          </div>
        </div>
        <div class="four wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
          <div class="ui inverted link list">
            <a href="https://gitee.com/manster1231" target="_blank" class="item">Gitee：https://gitee.com/manster1231</a>
            <a href="#" class="item">Email：manster1231@163.com</a>
            <a href="#" class="item">QQ：1249041911</a>
          </div>
        </div>
        <div class="six wide column">
          <h4 class="ui inverted header m-text-thin m-text-spaced">manster</h4>
          <p class="m-text-thin m-text-spaced m-opacity-mini">这里是manster的博客，有关我所知道的一切都愿与你交流</p>
          <p class="m-text-thin m-text-spaced m-opacity-mini">Talk is cheap show me the code</p>
        </div>
      </div>
      <div class="ui inverted section divider"></div>
      <p class="m-text-thin m-text-spaced m-opacity-tiny">CopyRight © 2021 - 2021 manster Designed by manster</p>
    </div>
  </footer>
  <!--/*/<th:block th:replace="blogfragments :: script">/*/-->
  <script src="../static/js/jquery-3.3.1.js"></script>
  <script src="../static/js/semantic.min.js"></script>
  <script type="text/javascript" color="240,248,255" opacity='0.8' zIndex="-1" count="99" src="../static/js/canvas-nest.js"></script>
  <!--/*/</th:block>/*/-->
  <script>
    $('.menu.toggle').click(function () {
      $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
      on : 'hover'
    });

    //消息提示关闭初始化
    $('.message .close').on('click', function () {
        $(this).closest('.message').transition('fade');
      });
  </script>
</body>
</html>